// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

import { game } from "../../../../script/game/control/game";
import { relationType } from "../../../../script/game/gameType";
import { ListViewAdapter } from "../../../../script/util/ListView/ListViewAdapter";
import { WinBase } from "../../../../script/wins/WinBase";

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends WinBase {

    @property(ListViewAdapter)
    list: ListViewAdapter = null;

    start () {
        this.registerEvent("updateRelation", () => {
            this.getFamily();
        });
        //获取
        this.getFamily();
    }
    getFamily() {
        let figures: relationType[] = game.playerMgr.bag.figureBag.bag.items;
        this.list.updateItems(figures);
    }

}
